/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.iftk.xmlparser.domain;

/**
 *
 * @author Tomi
 */
public class Floor extends BubbleItem {
    private String name;
    private String imageURL;
    
    public Floor(String name, String url) {
        this.name = name;
        this.imageURL = url;
    }

    public Floor(String name) {
        this.name = name;
    }
    
    public String getImageURL() {
        return imageURL;
    }

    public void setImageURL(String imageURL) {
        this.imageURL = imageURL;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        String NEW_LINE = System.getProperty("line.separator");
        
        result.append(this.getClass().getName()).append("Object {").append(NEW_LINE);
        result.append(" ID: ").append(getId()).append(NEW_LINE);
        result.append(" Floor: ").append(name).append(NEW_LINE);
        result.append(" URL to image: ").append(imageURL).append(NEW_LINE);
        result.append("}");
        
        return result.toString();
    }
    
    @Override
    public String toBubble() {
        StringBuilder result = new StringBuilder();
        String NEW_LINE = System.getProperty("line.separator");
        String floor = name;
        
        result.append("<bubble>").append(NEW_LINE);
        result.append("<id>").append(getId()).append("</id>").append(NEW_LINE);
        result.append("\t<titletext>").append(name).append("</titletext>").append(NEW_LINE);
        result.append("\t<shorttext></shorttext>").append(NEW_LINE);
        if(name.equals("1st Floor")) {
            result.append("\t<style>FirstFloor</style>").append(NEW_LINE);
        }
        else if(name.equals("2nd Floor")) {
            result.append("\t<style>SecondFloor</style>").append(NEW_LINE);
        }
        else if(name.equals("3rd Floor")) {
            result.append("\t<style>ThirdFloor</style>").append(NEW_LINE);
        }
        else if(name.equals("4th Floor")) {
            result.append("\t<style>FourthFloor</style>").append(NEW_LINE);
        }
        else {
            result.append("\t<style>GroundFloor</style>").append(NEW_LINE);
        }
        result.append("<priority>3</priority>").append(NEW_LINE);
        result.append("</bubble>").append(NEW_LINE);
        
        return result.toString();
    }
}
